package satirGame;
import java.io.*;

import javax.swing.JOptionPane;

public class OldEventClass extends java.lang.Object
{
       /* private static String[] qType={"Say","Action","Situation"};
        private String question;
        //private String content;
        private int type; //0: Say, 1:Action, 2:Situation
        private int totalPlayer;
        private int score;
        private int newQuestionIndex=0; //

        Object[] options;
     
        public Event(int t, int totalplayer) throws FileNotFoundException{
                setEventType(t);
                totalPlayer=totalplayer;
                //loadFile();
        }
 
        public void loadFile() throws FileNotFoundException {
                String strFromFile = null;
                int count = 0;
                try {
                        FileReader fr=new FileReader(String.valueOf(type));
                        BufferedReader bfr=new BufferedReader(fr);
                         //read each question and stop at new question not yet used
                        while ((strFromFile=bfr.readLine())!=null && count<newQuestionIndex) {
                                count++;
                        }
                        newQuestionIndex++; //index of new question point to next line of the database
                        
                        if (getEventType()==0 || getEventType()==1) {//set question and option for Event type 0 and 1
                                setEventquestion(strFromFile);
                                System.out.println(strFromFile);
                                options = new Object[]{"Good","Normal","Bad"};
                        }
                        else{//set question and option for Event type 2
                                String[] SituationItem = strFromFile.split(";");
                                setEventquestion(SituationItem[0]);
                                options = new Object[SituationItem.length-1];
                                for (int i = 0; i < SituationItem.length-1; i++) {
                                        options[i]=SituationItem[i];
                                }       
                        }
                        for(Object name:options){
                                System.out.println(name);
                        }
                        System.out.println((count+1)+" lines read");
                        if((strFromFile=bfr.readLine())==null){
                                newQuestionIndex=0;
                        }
        }catch(ArrayIndexOutOfBoundsException e) {
            System.out.println("½Ð«ü©wÀÉ®×¦WºÙ");//if file not found
        }catch(IOException e) { 
            e.printStackTrace(); 
        }
    }
 
        //set question
        public void setEventquestion(String q){
                question = q;
        }
        
        
        public String getEventquestion() {
                return question;
        }
        
        public void setEventType(int t) {
                type=t;
        }       
        
        public int getEventType() {
                return type;
        }       
        
        public void setScore(int s){
                score=s;
        }
        
        public int getScore(){
                return score;
        }
        
        public void setQuestionIndex(int s){
                newQuestionIndex=s;
        }
        
        public int getQuestionIndex(){
                return newQuestionIndex;
        }*/
}